export default {
    name: "Login",
    data() {
        return {
            captcha: '',
            form: {
                username: '',
                password: ''/*,
                verifyCode: '',
                pid:''*/
            }
        }
    },
    methods: {
        login(){
            console.log(JSON.stringify(this.form))
            this.$post('/admin/login',this.form)
                .then((response)=>{
                    if (response.code === 0) {
                        this.$ls.set("userInfo", response.data);
                        this.$router.push({path: '/'});
                    } else {
                        this.$message.error(response.errorMsg);
                    }
                });
        },

    },
    mounted() {
        // this.refreshCode();
    }
}
